<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'order.jsp' starting page</title>
  </head>
  <body>
	<h1>收货人信息</h1>   
	<form action="order.jspx?m=addorder ">
  	收货人:<input type="text" name="name" /><br/>
  	联系电话:<input type="text" name="tel" /><br/>
  	地址:<input type="text" name="address" /><br/>
  	<input type="submit" value="提交订单" /><br/>
	</form>
	<hr/>
	<h1>订单信息</h1>
  <a href="order.jspx">←返回继续购物</a>
  <table border="1px" width="70%">
  	<tr>
  	<td>商品名称</td><td>商品单价</td><td>数量</td><td>总价</td>
  	</tr>
  <c:if test="${empty sessionScope.shopCar }">
  	<c:redirect url="prod.jspx"></c:redirect>
  </c:if>
  <c:set var="total" value="0.0" />
  <c:forEach items="${sessionScope.shopCar }" var="item">
  	<c:set var="total" value="${pageScope.total+item.total }"/>
  	<tr>
  	<td>${item.prod.prodname }</td>
  	<td>${item.prod.price }</td>
  	<td>${item.num }</td>
  	<td>${item.total }</td>
  	</tr>
  </c:forEach>
  </table>
  <h1>总共付:￥${pageScope.total }元</h1>
  </body>
</html>
